package lab03.test01;

import java.io.*;

public class Test {
    public static void main(String[] args) {
        File file = new File("F:\\各类桌面文件\\hello.txt");

        System.out.println("文件路径：" + file.getAbsolutePath());

        BufferedReader reader = null;
        try{
            reader = new BufferedReader(new FileReader(file));
            String line = "";

            try{
                while ((line = reader.readLine()) !=null){
                    System.out.println(line);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }finally {
                try{
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }


        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

    }
}
